
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{if isset($SEO['title']) && !empty($SEO['title'])}{$SEO['title']}{/if}{$SEO['site_title']}</title>
<meta name="keywords" content="{$SEO['keyword']}">
<meta name="description" content="{$SEO['description']}">
<link href="{THEME_STYLE_PATH}style/css/default_new.css" type="text/css" rel="stylesheet" />
<script src="{THEME_STYLE_PATH}style/js/js/jquery.min.js"></script>
<script src="{THEME_STYLE_PATH}style/js/core.js"></script>
<!--script src="http://l.tbcdn.cn/apps/top/x/sdk.js?appkey=21635038"></script--><script src="{THEME_STYLE_PATH}style/js/func.common.js"></script>
<link href="{THEME_STYLE_PATH}style/css/percenter.css" type="text/css" rel="stylesheet" />
<link href="{THEME_STYLE_PATH}style/css/datepicker.css" rel="stylesheet">
<script src="{THEME_STYLE_PATH}style/js/bootstrap-datepicker.js"></script>
<!--[if IE 6]>
<script src="/js/DD_belatedPNG.js"></script>
<script>
  DD_belatedPNG.fix('*');
</script>
<![endif]-->
<!--[if IE 6]>
<style type="text/css">
    html{overflow:hidden;}
    body{height:100%;overflow:auto;}
</style>
<![endif]-->
<style>
input[disabled],
select[disabled],
textarea[disabled],
input[readonly],
select[readonly],
textarea[readonly] {
  cursor: not-allowed;
  background-color: #eeeeee;
}

input[type="radio"][disabled],
input[type="checkbox"][disabled],
input[type="radio"][readonly],
input[type="checkbox"][readonly] {
  background-color: transparent;
}
</style>
</head>

<body>
	<!--登录密码验证
		<div id="jxy_pop_popSys1" class="public_w" style="width: 420px; z-index: 9999; position: fixed; top: 175px; left: 739.5px; display: block;">
			<div class="public_w_in" style="width:420px;">
				<div class="public_w_t">
					<strong>安全验证</strong>
					<a title="关闭" onclick="juxiangyou.core.func.hidePopupDiv($('#jxy_pop_popSys1'));" href="javascript:void(0);"></a>
				</div>
				<div class="publick_w_c" style="padding-left: 10px; padding-right: 10px;">
					<p class="dlmm" style="margin-top:20px;">登录密码：<input type="text" /><label>密码错误!</label></p>
					<p class="btn" style="margin-top:20px; margin-bottom:10px;"><a onclick="doSure()" href="javascript:void(0);" id="" class="public_w_btn_y">确认</a></p>
				</div>
			</div>
		</div>
		-->
		<!--成功领取{type_change()}币奖励成功领取U币奖励
		<div id="jxy_pop_popSys1" class="public_w" style="width: 420px; z-index: 9999; position: fixed; top: 175px; left: 739.5px; display: block;">
			<div class="public_w_in" style="width:420px;">
				<div class="public_w_t">
					<strong>领取奖品</strong>
					<a title="关闭" onclick="juxiangyou.core.func.hidePopupDiv($('#jxy_pop_popSys1'));" href="javascript:void(0);"></a>
				</div>
				<div class="publick_w_c" style="padding-left: 10px; padding-right: 10px;">
					<p class="a2">您已成功领取</p>
					<p class="a2"><span class="g46">疯狂36排名奖品—30万U币</span></p>
					<p class="btn" style="margin-top:20px; margin-bottom:10px;"><a onclick="doSure()" href="javascript:void(0);" id="" class="public_w_btn_y">确认</a></p>
				</div>
			</div>
		</div>
		-->
	


<style>
.Navon {margin: 0 10px;position: relative;}
.Navun {margin: 0 10px;position: relative;}
#Nav .xinren {
	display: block;
	overflow: hidden;
	position: absolute;
	right: -10px;
	top: 8px;
}

#Nav .luntan,
#Nav .youxi,
#Nav .huiyuan {
	display: block;
	overflow: hidden;
	position: absolute;
	left: -10px;
	top: -15px;
}

#Nav .luntan {
	width: 54px;
	top: -15px;
	left: -5px;
}

</style>

{include template('header','common')}
	<div id="Mainbox">
		<!--插入侧边栏-->
		{include template('sidebar_login','common')}
		<!--插入侧边栏-->
		{include template('top_advance','common')}
		
		<!-- 左侧 -->
		{include template('member_left','common')}
		<!--右侧-->
		<div class="percenter_right">
			<div class="aboutper_acc">
								<p class="a1">我的奖品</p><!-- 
				<form id="jxy_form_search" method="get" action="">
				<div class="acc_serach"><strong>时间：</strong><input type="text" name="start" id="dpd1" value="2014-09-01" readonly/>&nbsp;&nbsp;<span class="da3">—</span>&nbsp;&nbsp;<input type="text" name="end" id="dpd2" value="2014-09-24" readonly/>&nbsp;&nbsp;&nbsp;<a href="javascript:void(0);" onclick="$('#jxy_form_search').submit()">搜索</a></div>
				</form>
 -->					<!--账户明细列表-->
					<table width="654" border="0" cellpadding="0" cellspacing="1" bgcolor="#dedede" class="prize_table">
					  <tr>
					    <td bgcolor="#ffffff" class="title a1">奖品名称</td>
					    <td bgcolor="#ffffff" class="title a2">消耗</td>
					    <td bgcolor="#ffffff" class="title a3">兑换时间</td>
					    <td bgcolor="#ffffff" class="title a4">收货人</td>
					    <td bgcolor="#ffffff" class="title a5">兑换状态</td>
					  </tr>
					  <?php if($tmps){ ?>
					  <?php foreach ($tmps as $key => $v) { ?>
					  <tr>
					    <td bgcolor="#ffffff" class="title a1"><?php echo $v['name'] ?></td>
					    <td bgcolor="#ffffff" class="title a2"><span class="ofe"><strong><?php echo number_format($v['number']); ?><img src="{THEME_STYLE_PATH}style/images/ud.gif">
												</strong></span></td>
					    <td bgcolor="#ffffff" class="title a3"><?php echo  date("Y-m-d H:i:s",$v['time']) ?></td>
					    <td bgcolor="#ffffff" class="title a4"><?php echo $v['consignee'] ?></td>
					    <td bgcolor="#ffffff" class="title a5"><?php if($v['status'] == 0) echo '待兑换'; else echo '已兑换'; ?></td>
					  </tr>
					  <?php  } ?>
					  <tr>
					  <td colspan="5" bgcolor="#ffffff"  class="pageup"><?php echo $pages; ?></td>
					  </tr>
					  <?php }else{ ?>

					  <tr>
						<td colspan="5" bgcolor="#ffffff" class="a1">没有记录</td>
					  </tr>
					  <?php } ?>
					</table>
					<!--账户明细列表-->
					<!--翻页模板-->
					<div class="pageup"></div>
					<!--翻页模板-->
							</div>
		</div>
		<!--右侧-->
		<div class="clear"></div>
	</div>
	<!--主体-->
	<!--尾部-->
	{include template('footer','common')}

	
	

	<!--尾部-->
</body>
</html>
<script typte="text/javascript">
var isLimit = true,coder = false;
$(function(){
 var nowTemp = new Date();
        var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0);

        var checkin = $('#dpd1').datepicker({format: 'yyyy-mm-dd',
          onRender: function(date) {
            return date.valueOf() < now.valueOf() ? 'disabled' : '';
          }
        }).on('changeDate', function(ev) {
          if (ev.date.valueOf() > checkout.date.valueOf()) {
            var newDate = new Date(ev.date)
            newDate.setDate(newDate.getDate() + 1);
            checkout.setValue(newDate);
          }
          checkin.hide();
          $('#dpd2')[0].focus();
        }).data('datepicker');
        var checkout = $('#dpd2').datepicker({format: 'yyyy-mm-dd',
          onRender: function(date) {
            return date.valueOf() <= checkin.date.valueOf() ? 'disabled' : '';
          }
        }).on('changeDate', function(ev) {
          checkout.hide();
        }).data('datepicker');

	
});


function getCardKey(id)
{
	var _html = ['<div id="jxy_pop_popSys1" class="public_w" style="width: 420px; z-index: 9999; position: fixed;"><div class="public_w_in" style="width:420px;"><div class="public_w_t"><strong>安全验证</strong><a title="关闭" onclick="juxiangyou.core.func.hidePopupDiv($(\'#jxy_pop_popSys1\'));" href="javascript:void(0);"></a></div><div class="publick_w_c" style="padding-left: 10px; padding-right: 10px;"><p class="dlmm" style="margin-top:20px;">登录密码：<input type="password" id="tbLoginPwd"/><br><label id="errorTip"></label></p><p class="btn" style="margin-top:20px; margin-bottom:10px;"><a onclick="doSure('+id+')" href="javascript:void(0);" id="makeSure" class="public_w_btn_y">确认</a></p></div></div></div>'];
	juxiangyou.component.popup._autoColse = false;juxiangyou.component.popup.box(_html,0,0);
}

function doSure(id)
{
	var p = $('#tbLoginPwd').val();var _id = 'jxy_pop_popSys1';
	if(!p){
		$("#errorTip").html("请输入登录密码！").fadeIn();
		setTimeout('$("#errorTip").fadeOut();', 1000);
	}
	$('#makeSure').html("提交中");
	if(!isLimit) return;
	isLimit = false;
	$.ajax({
		type:'POST',
		url:'/personal/Prize/',
		data:{"act":'exchangeDou',"id":id,"p":p},
		dataType:'json',
		error:function(){
			isLimit = true;juxiangyou.core.func.hidePopupDiv($('#'+_id));juxiangyou.component.popup.prompt("请求已经提交，请稍等片刻~");
		},
		success:function(rst){
			if(rst.error==10000){
				juxiangyou.core.func.hidePopupDiv($('#'+_id));
				window.location.href = "/personalPrize_New.php?id="+id+"&linkKey="+rst.linkKey;

			}else{
				juxiangyou.core.func.hidePopupDiv($('#'+_id));
				popup.prompt(rst.msg);
			}
			isLimit = true;
		}
	});

}

function cancelPrize(extID)
{
	var giftName = $('#gN'+extID).html();
	var str = '<p style="margin-top: 10px;text-indent: 2em;text-align: left;">您是否取消兑换<font style="color:red;">['+giftName+']</font>？</p>';
		str += '<p style="margin-top: 10px;text-indent: 2em;text-align:left;">验证码：<input type="text" id="tbCode" maxlength="6" _type="3" style="width:50px;">&nbsp;&nbsp;<span id="phoneArea"><a class="b40link" onclick="getCode(3)" href="javascript:void(0);">点击获取验证码</a></span><img style="vertical-align:-5px;display:none;" src="/images/login/right.png" id="tbCode_s"></p><p><span class="da3" id="tbCode_i"></span><span class="re1" id="tbCode_w" style="display:none;">格式输入有误!</span><span id="errorTip" class="re1" style="font-size: 12px;"></span></p>';
		str += '<p class="btn"><a href="javascript:void(0);"  class="public_w_btn_y">确认</a>&nbsp;&nbsp;&nbsp;<a class="public_w_btn_n" onclick="juxiangyou.core.func.hidePopupDiv($(\'#jxy_pop_popSys1\'));" href="javascript:void(0);">取消</a></p>';
	juxiangyou.component.popup.popSys1("取消兑奖",str);

	$('#jxy_pop_popSys1 .public_w_btn_y').click(function(){
		
		if(!coder){switchTip('tbCode',2);coder=false;return;}
		if(!isLimit) return;
		isLimit = false;
		$(this).html("提交中");
		var _id = 'jxy_pop_popSys1';
		var code_r = $.trim($('#tbCode').val());
		$.ajax({
			type:'POST',
			url:'/personal/Prize/',
			data:{"act":'cancelPrize',"extID":extID,'coder':code_r},
			dataType:'json',
			error:function(){
				isLimit = true;juxiangyou.core.func.hidePopupDiv($('#'+_id));juxiangyou.component.popup.prompt("请求已经提交，请稍等片刻~");
			},
			success:function(rst){
				if(rst.error==10000){
					juxiangyou.core.func.hidePopupDiv($('#'+_id));
					juxiangyou.component.popup._reload = true;coder=true;
					popup.popSys2(rst.msg);

				}else{
					juxiangyou.core.func.hidePopupDiv($('#'+_id));
					juxiangyou.component.popup._reload = false;coder=false;
					popup.prompt(rst.msg);
				}
				isLimit = true;
			}
		});
	});
}

</script>
